package com.meatball.core.validation

import jakarta.validation.Constraint
import jakarta.validation.Payload
import kotlin.reflect.KClass

/**
 * TODO 验证密码是否是md5格式
 *
 * @property message 如果验证失败，返回的默认消息
 * @property groups 用于分组验证，这里不做分组
 * @property payload 用于扩展验证的有效负载，通常不需要
 */
@Target(AnnotationTarget.FIELD, AnnotationTarget.VALUE_PARAMETER)
@Retention(AnnotationRetention.RUNTIME) // 注解在运行时保持有效
@Constraint(validatedBy = [PasswordValidator::class])
annotation class PasswordValidity(
    val message: String = "无效的密码格式",
    val groups: Array<KClass<*>> = [],
    val payload: Array<KClass<out Payload>> = []
)